/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.fatecpg.mdi;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author Fatec
 */
public class Conexão {
    
    private Connection connDB = null;
    
    public Connection getConexao() throws SQLException {
     connDB = DriverManager.getConnection("jdbc:mysql://localhost:3306/entrega_gado", "root", "");
     return connDB;
   }
    
    
    public void fecharConexao() throws SQLException {
      if (connDB != null) {
        connDB.close();
       }
   }

    ////public static java.sql.Connection conexãoJDBC;
    // static String SQL;

   // public static void Conectar(String usuario, String senha)
    //   throws ClassNotFoundException, SQLException {
    //   Class.forName("com.mysql.jdbc.Driver");
    //   Connection cn = DriverManager.getConnection("jdbc:mysql://localhost:3306/entrega_gado", "root", "mysql");
    //   Statement stm = cn.createStatement();
     //  stm.executeUpdate(SQL);

   // }

  //  public static void Desconectar()throws SQLException{
  //   conexãoJDBC.close();
  //  }

//    private static ResultSet executeQuery(String string) {
//        throw new UnsupportedOperationException("Not yet implemented");
//    }
}
